home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / BATCHCOL.ZIP / VIRUSES.ZIP / WINSTART.ZIP / WINSTART.TXT < prev   
Encoding:
Text File  |  1996-12-12  |  6.2 KB  |  136 lines

  1.  
  2.      Winstart
  3.  
  4.      -----------------------------------------------------------------
  5.      This virus is named after the WINSTART.BAT file where the body of
  6.      the virus is placed. That BAT file contains four text lines
  7.      followed by binary data:
  8.  
  9.       @ECHO  OFF
  10.       :s%r#
  11.       COPY %0.BAT C:\Q.COM>NUL
  12.       C:\Q
  13.       [ binary data ]
  14.  
  15.      On execution of that file the virus copies itself (the BAT file)
  16.      into the COM dropper, and executes it. That dropper is placed at
  17.      the root directory of C: drive with the name Q.COM. Being
  18.      executed it installs itself into the High Memory Area, hooks INT
  19.      2Fh, and creates the WINSTART.BAT files on floppy drives, and
  20.      copies the virus body into newly created BAT file.
  21.  
  22.      Execution of BAT-file
  23.  
  24.      The installation routine of WINSTART virus contains the common
  25.      ideas with the first memory resident BAT virus named BATMAN. As
  26.      well as BATMAN the WINSTART virus being executed receives control
  27.      as the batch file. It transforms itself into COM format by the
  28.      commands are listed in its text part:
  29.  
  30.       command                     action
  31.       -------                     ------
  32.       @ECHO  OFF                  disable the echoing
  33.       :s%r#                       this is the label, it is not executed in batch
  34.       COPY %0.BAT C:\Q.COM>NUL    copy the host file to C:\Q.COM
  35.       C:\Q                        run newly created C:\Q.COM
  36.  
  37.      The next line contains the binary data bytes that are begin with
  38.      1Ah byte. That byte indicates "end-of-file", and as the result
  39.      the binary code line will not be executed in batch mode.
  40.  
  41.      Execution of COM-file
  42.  
  43.      The Q.COM file is the copy of source BAT one, but while execution
  44.      it receives the control as COM file. The text strings are
  45.      executed by processor as "do-nothing" command such as:
  46.  
  47.       INC     AX          ;  '@'
  48.       INC     BP          ;  'E'
  49.       INC     BX          ;  'C'
  50.       DEC     AX          ;  'H'
  51.       DEC     DI          ;  'O'
  52.       AND     [BX+SI],AH  ;  '  '
  53.  
  54.      That dummy code is terminated with "label" string (second line in
  55.      BAT file). The processor executes that part of virus as the
  56.      instructions:
  57.  
  58.       JNC    Install      ;  's%'
  59.       JC     Install      ;  'r#'
  60.  
  61.      These instructions pass the control to binary part of the virus,
  62.      and that part installs the memory resident portion of WINSTART.
  63.  
  64.      Installation into the system memory
  65.  
  66.      First, the virus performs "Are you here?" call INT 2Fh with
  67.      AX=B700h. The memory resident portion of the virus returns FFh
  68.      value in AL register. That call is absolutely the same as
  69.      performed by DOS utility APPEND on installation, and they may
  70.      confuse each other. It shows the best way to protect oneself
  71.      against that virus - it is necessary to install APPEND utility
  72.      only.
  73.  
  74.      If there is no WINSTART virus copy in the system memory the virus
  75.      allocates the block of High Memory Area (HMA) with INT 2Fh
  76.      function AX=4A02h. The request is for 173 bytes only, and such
  77.      small hole is enough for virus to install itself into the memory.
  78.      It copies the part (168 bytes) of its code into allocated block,
  79.      and stores the INT 2Fh address into there (total 168+4=172
  80.      bytes). The code is copied contains the virus INT 2Fh handler and
  81.      infection routine only, the installation routine is not placed
  82.      into the virus TSR part. The address of interrupt 2Fh vector is
  83.      taken from the not documented DOS area (that address is new for
  84.      me, I've never seen it before!). That address is used by DOS 6.0+
  85.      when DOS internal INT 2Fh routines pass the control from one part
  86.      of code to another one.
  87.  
  88.      Then the virus performs the last part of installation routine,
  89.      that code is executed ever if there is no HMA memory and the
  90.      virus has not installed itself into the memory. It renames the
  91.      C:\Q.COM file with the name C:\WINSTART.BAT, and then deletes the
  92.      C:\Q.COM file. There is the reason for such deleting - if
  93.      WINSTART.BAT file already exist, the rename command fails, and
  94.      Q.COM file is not deleted while renaming. After deleting the
  95.      virus sets the attributes of C:\WINSTART.BAT to "read-only", and
  96.      terminates itself with INT 20h call.
  97.  
  98.      The result of installation routine is follow: the virus hooks INT
  99.      2Fh, keeps its INT 2Fh handler in HMA block, and leaves
  100.      C:\WINSTART.BAT file with the copy of the virus.
  101.  
  102.      INT 2Fh Handler
  103.  
  104.      The virus intercepts two INT 2Fh functions. The first one is "Are
  105.      you here?" call (or APPEND installation check) AX=B700h, in that
  106.      case the virus immediately returns FFh value in AL register.
  107.  
  108.      The second call is internal Installation Check AX=AE00h function
  109.      of COMMAND.COM processor. The last call is performed on execution
  110.      of new COMMAND.COM copy (on execution of any DOS application from
  111.      some file shell such as XTREE or NortonCommander for example). In
  112.      that case the virus passes the control to infection routine.
  113.  
  114.      The infection routine drops the copy of the virus on the current
  115.      drive under two conditions only:
  116.  
  117.        1. the current drive is A: or B:
  118.        2. it has 50% or less of free disk space (i.e. there are some
  119.           files that occupy 50% or more of that disk, and new file may
  120.           be "hidden" between other file names while DIR command)
  121.  
  122.      In that case the virus hooks INT 24h to prevent the DOS error
  123.      message while writing to write-protected disks, creates new
  124.      WINSTART.BAT file on the current (A: or B:) drive, and copies the
  125.      C:\WINSTART.BAT into there. While copying the virus uses INT 18h
  126.      address in Interrupt Table (addresses 0000:0060-0063) as
  127.      read-write buffer. That interrupt is not used during the DOS
  128.      session on any IBM-PC machine (that trick allows the virus to
  129.      save four bytes of memory is occupied!), but may have the
  130.      troubles on not IBM-PC clones.
  131.  
  132.      After copying the virus sets for destination file the file date
  133.      and time stamp the same as source file has, closes the files and
  134.      returns the control to original INT 2Fh address. The infection
  135.      has been done.
  136.